home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / misc_pto / objdumpf / objdump.doc next >
Text File  |  1988-09-18  |  14KB  |  397 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.           
  8.                            ONCE IN A BLUE MOON SOFTWARE'S
  9.                               OBJECT FILE DUMP FACILITY
  10.                                    COPYWRITE 1988
  11.           
  12.           
  13.           This program is released to the public domain by the author.
  14.           This software is designed to perform on IBM PCs, XTs, ATs,
  15.           PS/2s1, and their clones.  However, No guarantees, expressed or
  16.           implied are made.  You may make as many copies of the program as
  17.           you like and distribute them as you see fit.  You may not alter
  18.           the program or its documentation.  Nor may you charge any fees
  19.           for distributing or using this software.
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57. ____________________
  58.           1 IBM, PC/AT, and PS/2 are registered trademarks of International
  59.                Business Machines Corporation.
  60.           
  61.  
  62.  
  63.  
  64.           Once in a Blue Moon Software's Object File Dump Facility                -1-
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.           PURPOSE
  74.           
  75.           The object file dump facility is a programmer's tool designed to
  76.           display Intel/Microsoft2 compatible object files.  It is assumed
  77.           that you are somewhat familiar with object file format and
  78.           assembly language.  A few basics of the format are discussed
  79.           here.  For additional information on the object file format
  80.           consult Intel/Microsoft documentation.
  81.           
  82.           HOW TO RUN OBJDUMP
  83.           
  84.           Start the object file dump facility by entering the executable
  85.           file name and optionally a complete or partial file specification
  86.           on the DOS command line:
  87.           
  88.                     C:\>OBJDUMP [drivespec:] [\path] [\filespec]
  89.           
  90.           Where drivespec is a valid drive such as C:, path is any valid
  91.           pathname and filespec is a full file name or a partial filename
  92.           such as *.obj.  For example, if you wanted to dump an object file
  93.           named myobj.obj in the masm directory, you would enter:
  94.           
  95.                            C:\>OBJDUMP C:\MASM\MYOBJ <Ret>
  96.           
  97.           To select from all of the object files in the masm directory you
  98.           would type:
  99.           
  100.                            C:\>OBJDUMP C:\MASM\*.OBJ <Ret>
  101.           
  102.           If you don't specify anything on the command line, the current
  103.           drive and directory and the default file specification ,*.OBJ,
  104.           will be assumed.
  105.           
  106.           The screen will clear and the Once in a Blue Moon logo will
  107.           display for a few seconds.  Next a window will open with a list
  108.           of files matching the file specification you entered on the
  109.           command line, or the default.  You may select a file or change
  110.           directories by using the cursor keys and the pgup and pgdn keys.
  111.           Once you have highlighted the file or directory you want press
  112.           <Ret>.  If you want to abandon the program, press <Esc>.
  113.           
  114.           After you have selected a file, you will be prompted for console,
  115.           printer, or file  output.  Simply press "c", "p" or "f" as
  116.           appropriate.  If you specify file output you will be prompted for
  117.           a file name.
  118.           
  119.  
  120.  
  121.  
  122.  
  123. ____________________
  124.           2 Intel and Microsoft are registered trademarks of their
  125.                respective corporations.
  126.           
  127.  
  128.  
  129.  
  130.           Once in a Blue Moon Software's Object File Dump Facility                -2-
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.           The printer option was designed for Epson FX3 or compatible
  140.           printers.  For readability, the printout is in compressed form.
  141.           If there is a problem with your printout, your printer is
  142.           probably not Epson FX compatible.  If you need hard copy and
  143.           don't have an Epson FX printer use the file output option.
  144.           Thenprint the file from the DOS command line with redirection
  145.           like this:
  146.           
  147.                               C:\>COPY OBJDUMP.TXT PRN
  148.           
  149.           OBJDUMP'S OUTPUT FORMAT
  150.           
  151.           The file dump will begin on screen with a prompt to continue.  If
  152.           you elect to leave the program at this point simply press <Esc>.
  153.           The file dump to the printer or file is continuous.  The file
  154.           dump format will look something like this:
  155.           
  156. Object File Dump Facility : C:\C\MVARSTCK.OBJ  Page 1
  157.  
  158. Ofs    Type  Cde  Lngth              Record                  Chk     ASCII
  159. 0     THEADR  80  9      07 4E 4D 41 4C 4C 4F 43              6A    .NMALLOC
  160. C     LNAMES  96  1F     00 04 43 4F 44 45 04 44 41 54 41 06  10    ..CODE.DATA
  161.                          44 47 52 4F 55 50 05 5F 44 41 54 41        DGROUP._DATA
  162.                          05 5F 54 45 58 54                          ._TEXT
  163. 2E    SEGDEF  98  7      48 B2 00 06 02 01                    5E    H.....
  164. 38    SEGDEF  98  7      48 0C 00 05 03 01                    4     H.....
  165. 42    GRPDEF  9A  4      04 FF 02                             5D    ...
  166. 49    EXTDEF  8C  28     06 53 54 4B 48 51 51 00 04 5F 65 6E  4E    .STKHQQ.._en
  167.                          64 00 09 5F 5F 61 6D 61 6C 6C 6F 63        d..__amalloc
  168.                          00 0C 5F 5F 61 6D 61 6C 6C 6F 63 62        ..__amallocb
  169.                          72 6B                                      rk.
  170. 74    LEDATA  A0  6      02 00 00 00 00                       58    .....
  171. 7D    LIDATA  A2  E      02 02 00 0A 00 01 00 01 00 00 00 01  3F    ............
  172.                          00                                         .
  173. 8E    LEDATA  A0  B6     01 00 00 55 8B EC 8B 5E 06 0B DB 74  2D    ...U...^...t
  174.                          04 80 4F FE 01 8B E5 5D CB 55 8B EC        ..O....].U..
  175.                          56 57 BB 00 00 83 3F 00 75 29 1E 07        VW....?.u).
  176.                          B8 05 00 E8 00 00 75 05 33 C0 99 EB        ......u.3...
  177.                          7E 40 24 FE A3 00 00 A3 00 00 96 C7        ~@$.........
  178.                          04 01 00 83 C6 04 C7 44 FE FE FF 89        .......D....
  179.                          36 00 00 8B 4E 06 8C D8 8E C0 E8 00        6...N.......
  180.                          00 0B C0 75 56 A1 00 00 BB 00 00 80        ...uV.......
  181.                          E3 FE 3B C3 74 0E 2B C3 48 48 89 07        ..;.t.+.HH..
  182.                          89 1E 00 00 89 1E 00 00 B8 14 01 8B        ..........
  183.                          1E 00 00 8B F3 03 76 06 72 AA 03 F0        .....v.r...
  184.                          72 A6 3B F4 73 A2 BE 0E 01 8B FB 03        r.;.s.......
  185.                          FE 72 99 03 C7 72 95 3B C4 73 91 01        .r...r.;.s..
  186.                          36 00 00 8B 07 2B C6 89 05 89 3E 00        6....+....>.
  187.                          00 4E 89 37 E9 00 00 5F 5E 8B E5 5D        .N.7..._^..]
  188.                          CB                                         .
  189. ____________________
  190.           3 Epson and FX are registered trademarks of Epson America
  191.                Incorporated.
  192.           
  193.  
  194.  
  195.  
  196.           Once in a Blue Moon Software's Object File Dump Facility                -3-
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205. 147   FIXUPP  9C  57     C4 18 10 01 02 02 00 84 25 06 01 04  CB    ........%...
  206.                          C4 32 10 01 02 02 00 C4 35 10 01 02        .2......5...
  207.                          04 00 C4 46 10 01 02 08 00 84 50 06        ...F......P.
  208.                          01 03 C4 57 10 01 02 02 00 C4 5A 12        ...W......Z.
  209.                          01 02 01 00 C4 6B 10 01 02 02 00 C4        .....k......
  210.                          6F 14 01 02 C4 76 14 01 02 C4 9A 16        o....v......
  211.                          01 01 C4 A4 14 01 02 84 AA 00 01 01        ............
  212.                          17 00                                      ..
  213. 1A1   PUBDEF  90  C      00 01 05 5F 66 72 65 65 00 00 00     5D    ..._free...
  214. 1B0   PUBDEF  90  E      00 01 07 5F 6D 61 6C 6C 6F 63 12 00  71    ..._malloc..
  215.                          00                                         .
  216. 1C1   PUBDEF  90  F      01 02 08 5F 5F 61 73 65 67 64 73 02  1F    ...__asegds.
  217.                          00 00                                      ..
  218. 1D3   PUBDEF  90  E      00 01 07 5F 5F 6E 66 72 65 65 00 00  8C    ...__nfree..
  219.                          00                                         .
  220. Object File Dump Facility : C:\C\MVARSTCK.OBJ  Page 2
  221.  
  222. Ofs    Type  Cde  Lngth              Record                  Chk     ASCII
  223.  
  224.  
  225. 1E4   PUBDEF  90  10     00 01 09 5F 5F 6E 6D 61 6C 6C 6F 63  A0    ...__nmalloc
  226.                          12 00 00                                   ...
  227. 1F7   MODEND  8A  2      00
  228.           
  229.           The object file format is simply a collection of variable length
  230.           records characterized by several distinct fields.  The Object
  231.           File Dump Facility presents the object module as individual
  232.           records separated by their associated fields.  Additional data is
  233.           added to clarify the meaning of the dump.
  234.           
  235.           Each object module record is made up four basic fields.  The
  236.           first is a byte indicating what type of record follows.  The next
  237.           two bytes are the length of the record.  The remaining
  238.           bytes(variable in length) are the actual object module data.  And
  239.           the final byte is a checksum of the preceding record.
  240.           
  241.           These fields are outlined by the headings at the top of each
  242.           page.  All numerical entries are in hexadecimal notation.  The
  243.           fields are further detailed as follows:
  244.           
  245.              Ofs(offset):  This is the record offset of the object file
  246.              you are dumping. The first record is always 0.  This value
  247.              is not a part of the actual object file.
  248.              
  249.              Type:  This is the type of object record in six letter
  250.              abbreviated format, as proposed by Microsoft.  The
  251.              following are the possible types supported by Microsoft and
  252.              compatible linkers, assemblers, and compilers4:
  253.              
  254.  
  255. ____________________
  256.           4 Microsoft Systems Journal, March 1988, "Exploring the Structure
  257.                and Contents of the MS-DOS Object Module Format", Wilton,
  258.                Richard, p 60.
  259.  
  260.  
  261.  
  262.           Once in a Blue Moon Software's Object File Dump Facility                -4-
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.                80h  THEADR    Translator Header Record
  272.                88h  COMMENT   Comment Record
  273.                8Ah  MODEND    Module End Record
  274.                8Ch  EXTDEF    External Definition Record
  275.                8Eh  TYPDEF    Type Definition Record
  276.                90h  PUBDEF    Public Names Definition Record
  277.                94h  LINNUM    Line Number Record
  278.                96h  LNAMES    List of Names Record
  279.                98h  SEGDEF    Segment Definition Record
  280.                9Ah  GRPDEF    Group Definition Record
  281.                9Ch  FIXUPP    Fixup Record
  282.                A0h  LEDATA    Logical Enumerated Data
  283.                A2h  LIDATA    Logical Iterated Data
  284.                B0h  COMDEF    Communal Names Definition Record
  285.              
  286.              The record name is not part of the actual object file, but
  287.              is derived from the first byte in the actual object record.
  288.              
  289.              Cde(Code):  This hexadecimal byte is the first byte in each
  290.              object record.  It corresponds to the object record types
  291.              as listed in the above paragraph.
  292.              
  293.              Lngth(Length):  The record length is the next two bytes of
  294.              the object record.  It is listed in the Object File Dump
  295.              Facility as a single hexadecimal word.  However it is
  296.              stored in the usual low-order-byte-first form in the actual
  297.              object record.
  298.              
  299.              Record:  This is the actual object file record output in
  300.              hexadecimal format.  The Object File Dump Facility lists it
  301.              in the same order it is found in the object file.  This
  302.              data may be actual code or data, or it may be any one of
  303.              the data types as indicated by the 'type' field.
  304.              
  305.              Chk:(CheckSum):  This is the record checksum of all of the
  306.              preceding bytes in the record.  It is calculated by taking
  307.              the negative(two's compliment) of each of the bytes, adding
  308.              them together and taking the modulus 100h of the result.
  309.              
  310.              ASCII : This is a repeat of the data found in the record
  311.              field of the object file dump in Ascii format.  Non text
  312.              bytes are coded as a period(".").
  313.              
  314.           LEAVING OBJDUMP
  315.           
  316.           After each page of a console file dump you will be prompted to
  317.           strike any key to continue.  If you wish to exit the program,
  318.           simply press <Esc>.
  319.           
  320.           At the end of the dump you will be prompted to "strike any key to
  321.           end".  After this the program will end, the screen will clear and
  322.           you will be returned to DOS.
  323.           
  324.  
  325.  
  326.  
  327.  
  328.           Once in a Blue Moon Software's Object File Dump Facility                -5-
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.           We hope you will find the Once in a Blue Moon Object File Dump
  338.           Facility a useful and educational tool.  If you have any comments
  339.           or suggestions, send them to:
  340.           
  341.                             Once in a Blue Moon Software
  342.                                   1091 Circle Drive
  343.                                    Dover, DE 19901
  344.                                           
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.           Once in a Blue Moon Software's Object File Dump Facility                -6-
  395.  
  396.  
  397.